<template>
	<div>
		<h2>showInfo {{ message }}</h2>
		<button @click="showInfoBtnClick">发送事件</button>
	</div>
</template>

<script setup>
const props = defineProps({
	message: {
		type: String,
		default: '',
	},
})

const emits = defineEmits(['infoBtnClick'])
function showInfoBtnClick() {
	emits('infoBtnClick', '123')
}

function foo() {
	console.log('showInfo foo')
}

// 如果想要将组件中的函数,变量暴露出去,需要使用defineExpose
defineExpose({
	foo,
})
</script>

<style lang="scss" scoped></style>
